import random
rand=random.randint(1,100)

count=1
while count <=10:
    guess = eval(input('请你来猜猜看数字是：'))
    if guess == rand:
        if 1<=count<4:
            print('太棒了！你只用',count,'次就猜对了！\n挑战成功！')
        elif 4<=count<8:
            print('还不错！你用了',count,'次猜对了！\n挑战成功！')
        elif 8<=count<=10:
            print('通关！你用了',count,'次猜对了！\n挑战成功！')
        break
    elif guess<rand:
        print('猜小了')
    elif guess>rand:
        print('猜大了')
    count+=1
else:
    print('猜测次数过多，挑战失败了')

